package com.fz.mapper.system;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fz.dto.system.user.UserQuery;
import com.fz.entity.system.Dictionary;
import com.fz.entity.system.Menu;
import com.fz.entity.system.Role;
import com.fz.entity.system.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fz.vo.system.user.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author fh
 * @since 2021-03-03
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
     List<Menu> findMenuPermission(@Param("userid") String userid);

     List<Role> findRolePermission(@Param("userid") String userid);

    /**
     * 查询用户分页
     *
     * @param page           分页
     * @param lambdaQueryWrapper 查询条件
     * @return
     */
    Page<UserVo> findUserList(Page<UserVo> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<User> lambdaQueryWrapper);

    /**
     * 查询用户不分页
     *
     * @param lambdaQueryWrapper 查询条件
     * @return
     */
    List<UserVo> selectUsersList(@Param(Constants.WRAPPER) LambdaQueryWrapper<User> lambdaQueryWrapper);
}
